home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Trading on the Edge
/
Trading On The Edge - CD-ROM Toolkit (Wayzata Technology)(2031)(1994).bin
/
pc
/
mac_file
/
vendor_d
/
ga_softw
/
ooga
/
ga-meth.lis
< prev
next >
Wrap
File List
|
1991-02-03
|
2KB
|
71 lines
;;; -*- Mode:Lisp; Package:OOGA; Base:10; Syntax:COMMON-LISP -*-
#||
RESTRICTED RIGHTS LEGEND
Use, duplication, or disclosure by the Government is subject to
restrictions as set forth in subdivision (b)(3)(ii) of the Rights in
Technical Data and Computer Software Clause at 52.227-7013 of the DOD
FAR Supplement.
TSP (The Software Partnership)
P.O. Box 991
Melrose, MA 02176
Copyright 1990 by Lawrence Davis and Daniel Cerys, all rights reserved.
||#
(in-package :ooga)
;************************************************************
; GENETIC ALGORTHM
;;; RUN is the top-level driver. It calls the initialization
;;; processes, drives the initialization of the population,
;;; drives the evolution process, and carries out final
;;; processing.
(defmethod RUN ((ga basic-genetic-algorithm))
"Top-level loop to drive the genetic process."
(initialize-for-run ga)
(initialize-population (population-module ga))
(evolve (population-module ga))
(terminate-run ga))
(defmethod INITIALIZE-FOR-RUN ((ga basic-genetic-algorithm))
"Set up the GA for a run."
(setf (ga (population-module ga)) ga
(ga (reproduction-module ga)) ga
(ga (evaluation-module ga)) ga)
(initialize-for-run (population-module ga))
(initialize-for-run (reproduction-module ga))
(initialize-for-run (evaluation-module ga)))
;;; The TERMINATE-RUN processes are no ops. They are provided
;;; as hooks for user-defined methods.
(defmethod TERMINATE-RUN ((ga basic-genetic-algorithm))
"Carry out post-processing."
(terminate-run (population-module ga))
(terminate-run (reproduction-module ga))
(terminate-run (evaluation-module ga)))
(defmethod TERMINATE-RUN ((module basic-population-module))
t)
(defmethod TERMINATE-RUN ((module basic-reproduction-module))
t)
(defmethod TERMINATE-RUN ((module basic-evaluation-module))
t)